import type { RouteRecordRaw } from 'vue-router'

const Layout = () => import('@/layout/index.vue')

const routeModuleList: Array<RouteRecordRaw> = [
  {
    path: '/home',
    name: 'Home',
    redirect: '/home/index',
    component: Layout,
    meta: {
      title: '首页',
      icon: 'i-simple-icons:atlassian',
    },
    children: [
      {
        path: 'index',
        name: 'HomePage',
        meta: {
          keepAlive: false,
        },
        component: () => import('@/views/home/index.vue'),
      },
    ],
  },
  // {
  //   path: '/message',
  //   name: 'Message',
  //   redirect: '/message/index',
  //   component: Layout,
  //   meta: {
  //     title: '图表',
  //     icon: 'i-simple-icons:soundcharts',
  //   },
  //   children: [
  //     {
  //       path: 'index',
  //       name: 'MessagePage',
  //       meta: {
  //         keepAlive: false,
  //       },
  //       component: () => import('@/views/message/index.vue'),
  //     },
  //   ],
  // },
  {
    path: '/example',
    name: 'Example',
    redirect: '/example/index',
    component: Layout,
    meta: {
      title: '扫一扫',
      icon: 'i-material-symbols:award-star',
    },
    children: [
      {
        path: 'index',
        name: 'ExamplePage',
        meta: {
          keepAlive: false,
        },
        component: () => import('@/views/example/index.vue'),
      },
    ],
  },
  {
    path: '/mall',
    name: 'Mall',
    redirect: '/mall/index',
    component: Layout,
    meta: {
      title: '积分商城',
      icon: 'i-material-symbols:award-star',
    },
    children: [
      {
        path: 'index',
        name: 'MallPage',
        meta: {
          keepAlive: false,
        },
        component: () => import('@/views/mall/index.vue'),
      },
    ],
  },
  {
    path: '/points-detail',
    name: 'PointsDetail',
    meta: {
      keepAlive: false,
      title: '积分明细',
    },
    component: () => import('@/views/mall/points-detail/index.vue'),
  },
  {
    path: '/goods-detail',
    name: 'GoodsDetail',
    meta: {
      keepAlive: false,
      title: '商品详情',
    },
    component: () => import('@/views/mall/goods-detail/index.vue'),
  },
  {
    path: '/map',
    name: 'Map',
    redirect: '/map/index',
    meta: {
      title: '首页',
    },
    children: [
      {
        path: 'index',
        name: 'MapPage',
        meta: {
          keepAlive: false,
        },
        component: () => import('@/views/map/index.vue'),
      },
    ],
  },
  {
    path: '/user',
    name: 'User',
    meta: {
      title: '我的',
      innerPage: true,
    },
    component: () => import('@/views/user/index.vue'),
  },
  {
    path: '/redemption-center',
    name: 'RedemptionCenter',
    meta: {
      title: '兑换中心',
      innerPage: true,
    },
    component: () => import('@/views/user/redemption-center/index.vue'),
  },
  {
    path: '/write-off',
    name: 'WriteOff',
    meta: {
      title: '核销',
      innerPage: true,
    },
    component: () => import('@/views/user/write-off/index.vue'),
  },
  {
    path: '/confirm-write-off',
    name: 'ConfirmWriteOff',
    meta: {
      title: '确认核销',
      innerPage: true,
    },
    component: () => import('@/views/user/redemption-center/confirm-write-off/index.vue'),
  },

  {
    path: '/ar',
    name: 'Ar',
    redirect: '/ar/index',
    meta: {
      title: 'ar',
    },
    children: [
      {
        path: 'index',
        name: 'ArPage',
        meta: {
          keepAlive: true,
        },
        component: () => import('@/views/ar/index.vue'),
      },
    ],
  },
  // ar2 仅用于测试：线上环境异常，本地正常，vconsole线上环境自动关闭，无法查看线上环境网络请求；ar2改用本地图片上传
  {
    path: '/ar2',
    name: 'Ar2',
    redirect: '/ar2/index',
    meta: {
      title: 'ar',
    },
    children: [
      {
        path: 'index',
        name: 'ArPage2',
        meta: {
          keepAlive: true,
        },
        component: () => import('@/views/ar2/index.vue'),
      },
    ],
  },
  {
    path: '/cardAlbum',
    name: 'CardAlbum',
    redirect: '/cardAlbum/index',
    meta: {
      title: '集卡册',
    },
    children: [
      {
        path: 'index',
        name: 'CardAlbum',
        meta: {
          keepAlive: false,
        },
        component: () => import('@/views/cardAlbum/index.vue'),
      },
    ],
  },
  // 活动页面
  {
    path: '/idiom',
    name: 'Idiom',
    redirect: '/idiom/index',
    meta: {
      title: '成语答题',
    },
    children: [
      {
        path: 'index',
        name: 'IdiomPage',
        meta: {
          keepAlive: false,
        },
        component: () => import('@/views/activities/idiom/index.vue'),
      },
    ],
  },
  {
    path: '/jigsaw',
    name: 'Jigsaw',
    redirect: '/jigsaw/index',
    meta: {
      title: '扇面拼图',
    },
    children: [
      {
        path: 'index',
        name: 'JigsawPage',
        meta: {
          keepAlive: false,
        },
        component: () => import('@/views/activities/jigsaw/index.vue'),
      },
    ],
  },
  {
    path: '/treasureHunt',
    name: 'TreasureHunt',
    redirect: '/TreasureHunt/index',
    meta: {
      title: '知青寻宝',
    },
    children: [
      {
        path: 'index',
        name: 'TreasureHunt',
        meta: {
          keepAlive: false,
        },
        component: () => import('@/views/activities/treasureHunt/index.vue'),
      },
    ],
  },
  {
    path: '/collectCard',
    name: 'CollectCard',
    redirect: '/CollectCard/index',
    meta: {
      title: 'AR集卡',
    },
    children: [
      {
        path: 'index',
        name: 'CollectCard',
        meta: {
          keepAlive: false,
        },
        component: () => import('@/views/activities/collectCard/index.vue'),
      },
    ],
  },
  {
    path: '/guidance',
    name: 'Guidance',
    redirect: '/Guidance/index',
    meta: {
      title: '知青务农',
    },
    children: [
      {
        path: 'index',
        name: 'Guidance',
        meta: {
          keepAlive: false,
        },
        component: () => import('@/views/activities/guidance/index.vue'),
      },
    ],
  },
  {
    path: '/groupPhoto',
    name: 'GroupPhoto',
    redirect: '/groupPhoto/index',
    meta: {
      title: '知青合影',
    },
    children: [
      {
        path: 'index',
        name: 'GroupPhoto',
        meta: {
          keepAlive: false,
        },
        component: () => import('@/views/activities/groupPhoto/index.vue'),
      },
    ],
  },
  // {
  //   path: '/my',
  //   name: 'My',
  //   redirect: '/my/index',
  //   component: Layout,
  //   meta: {
  //     title: '我的',
  //     icon: 'i-simple-icons:docsify',
  //   },
  //   children: [
  //     {
  //       path: 'index',
  //       name: 'MyPage',
  //       meta: {
  //         keepAlive: false,
  //         hiddenHeader: true,
  //       },
  //       component: () => import('@/views/my/index.vue'),
  //     },
  //   ],
  // },

  // my innerPage
  {
    path: '/editUserInfo',
    name: 'EditUserInfo',
    meta: {
      title: '编辑个人信息',
      innerPage: true,
    },
    component: () => import('@/views/my/EditUserInfo.vue'),
  },
  {
    path: '/editNickname',
    name: 'EditNickname',
    meta: {
      title: '修改昵称(该页面已缓存)',
      innerPage: true,
      keepAlive: true,
    },
    component: () => import('@/views/my/EditNickname.vue'),
  },
  {
    path: '/editSign',
    name: 'EditSign',
    meta: {
      title: '修改签名',
      innerPage: true,
    },
    component: () => import('@/views/my/EditSign.vue'),
  },
  {
    path: '/accountSetting',
    name: 'AccountSetting',
    meta: {
      title: '账号与安全',
      innerPage: true,
    },
    component: () => import('@/views/my/AccountSetting.vue'),
  },
  {
    path: '/changePassword',
    name: 'ChangePassword',
    meta: {
      title: '修改登录密码',
      innerPage: true,
    },
    component: () => import('@/views/my/ChangePassword.vue'),
  },
  {
    path: '/themeSetting',
    name: 'ThemeSetting',
    meta: {
      title: '主题设置',
      innerPage: true,
    },
    component: () => import('@/views/my/ThemeSetting.vue'),
  },
]

export default routeModuleList
